<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>支出渠道管理</title>
    </h:head>
    <style type="text/css">
        .tableStyle{
            margin:10px 0px 5px 0px;
        }
        .gridStyle{
            margin:10px 10px 10px 0px;
        }
        input{
            margin:1px 1px 1px 2px;
        }
        input[type='submit']{
            margin:3px 5px 3px 5px;
            padding:2px 5px 2px 5px;
        }
        .top{
            vertical-align: top;
        }
    </style>
    <h:body>
        <h:form id="classCode">
            <rich:panel header="支出渠道管理" styleClass="content-hight">
                <rich:messages globalOnly="true"/>
                <rich:toolbar  itemSeparator="grida">
                    <rich:toolbarGroup>
                        <a4j:commandButton value="新增"  action="#{class.add}"    render="edit"  >
                        </a4j:commandButton>
                        <a4j:commandButton value="保存"  action="#{class.checkRpt}"   render="classCode"   >
                        </a4j:commandButton>
                        <a4j:commandButton value="修改"  action="#{class.update}" render="edit,classcodetable"  >
                        </a4j:commandButton>
                        <a4j:commandButton value="删除"  action="#{class.checkDelete}" render="edit,classcodetable"  >
                        </a4j:commandButton>
                    </rich:toolbarGroup>
                </rich:toolbar>
                <h:panelGroup  id="edit">
                    <h:panelGrid columns="2" width="30%" border="0" id="editForm" style="text-align:left;">
                        <h:outputLabel value="支出渠道编码" />
                        <h:inputText  id="code" disabled="true"  size="15" value="#{class.classcode.code}"  />
                        <h:outputLabel value="名称:" />
                        <h:inputText  id="name"  disabled="#{class.showAble}" size="15"  value="#{class.classcode.name}" />
                    </h:panelGrid>
                </h:panelGroup>

                <rich:dataTable  value="#{class.classModel}" var="cla" id="classcodetable"
                                 rows="10" style=" width: 300px;" >
                    <rich:column style=" text-align:  center;">
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="支出渠道代码"/>
                            </h:panelGroup>
                        </f:facet>
                        <a4j:commandLink action="#{class.show}" render="edit" >
                            <h:outputText value="#{cla.code}"/>
                        </a4j:commandLink>
                    </rich:column>
                    <rich:column >
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="名称"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{cla.name}"/>
                    </rich:column>
                </rich:dataTable>
                <rich:dataScroller for="classcodetable" />
            </rich:panel>
        </h:form>
    </h:body>
</html>
